import request from '@/utils/request'

// 定义公共的api
const BASE_URL = '/admin/movie/category'

export default {
  // 查询用户和分页
  getPageList(page, limit) {
    return request({
      url: `${BASE_URL}/${page}/${limit}`,
      method: 'get'
    })
  },
  // 添加或者修改用户
  saveCategory(category) {
    return request({
      url: `${BASE_URL}/addCategory`,
      method: 'post',
      data: category
    })
  },
  // 修改
  updateCategory(category) {
    return request({
      url: `${BASE_URL}/updateCategory`,
      method: 'post',
      data: category
    })
  },
  // 根据id去得到一个用户
  getCategoryById(id) {
    return request({
      url: `${BASE_URL}/findCategoryById/${id}`,
      method: 'get'
    })
  },
  removeId(id) {
    return request({
      url: `${BASE_URL}/removeCategoryById/${id}`,
      method: 'delete'
    })
  },
  bactchremoveId(ids) {
    return request({
      url: `${BASE_URL}/batchRemove`,
      method: 'delete',
      data: ids
    })
  }
}
